package com.horqian.api.oktoberfest

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent


class BootReceiver: BroadcastReceiver() {
    private val ACTION_BOOT = "android.intent.action.BOOT_COMPLETED"
    override fun onReceive(context: Context, intent: Intent) {
        if (ACTION_BOOT.equals(intent.action)) {
            //开机启动完成后,打开app
            val sayHelloIntent = Intent(context, MainActivity::class.java)
            sayHelloIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
            context.startActivity(sayHelloIntent)
        }
    }
}